export function Getdate() {
    // 获取当前日期
    var date = new Date();
    // 获取当前月份
    var nowMonth = date.getMonth() + 1;
    // 获取当前是几号
    var strDate = date.getDate();
    //获取当前星期几
    var weekday = new Array(7);
    weekday[0] = "Sun";
    weekday[1] = "Mon";
    weekday[2] = "Tue";
    weekday[3] = "Wed";
    weekday[4] = "Thu";
    weekday[5] = "Fri";
    weekday[6] = "Sat";
    var n = weekday[date.getDay()];
    //获取小时
    var hours = ('0' + now.getHours()).slice(-2);
    //获取分钟
    var minutes = ('0' + now.getMinutes()).slice(-2);
    // 获取秒
    var seconds = ('0' + now.getSeconds()).slice(-2);
    // 添加分隔符“-”
    var seperator = "";
    // 对月份进行处理，1-9月在前面添加一个“0”
    if (nowMonth >= 1 && nowMonth <= 9) {
        nowMonth = "0" + nowMonth;
    }
    // 对日进行处理，1-9号在前面添加一个“0”
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    // 最后拼接字符串，得到一个格式为(yyyy-MM-dd)的日期
    // var nowDate_01 = date.getFullYear() + seperator + nowMonth + seperator + strDate 
    var nowDate = date.getFullYear() + seperator + nowMonth + seperator + strDate  + hours + seperator + minutes +seconds;
    return nowDate
}